<template>
  <div class="admin-container">
    <h1>管理中心</h1>
    <p class="admin-description">欢迎使用吉居榭房产系统管理中心</p>
    
    <el-row :gutter="20" class="card-container">
      <el-col :span="8">
        <el-card shadow="hover" class="admin-card" @click="navigateTo('/admin/houses')">
          <div class="card-icon">
            <el-icon><HomeFilled /></el-icon>
          </div>
          <div class="card-content">
            <h3>房源管理</h3>
            <p>管理所有房源信息</p>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="8">
        <el-card shadow="hover" class="admin-card" @click="navigateTo('/admin/house-assign')">
          <div class="card-icon">
            <el-icon><Tools /></el-icon>
          </div>
          <div class="card-content">
            <h3>房源分配</h3>
            <p>管理房源分配记录</p>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="8">
        <el-card shadow="hover" class="admin-card" @click="navigateTo('/admin/view-records')">
          <div class="card-icon">
            <el-icon><UserFilled /></el-icon>
          </div>
          <div class="card-content">
            <h3>经纪人审核</h3>
            <p>审核经纪人申请</p>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="8">
        <el-card shadow="hover" class="admin-card" @click="navigateTo('/admin/login-logs')">
          <div class="card-icon">
            <el-icon><User /></el-icon>
          </div>
          <div class="card-content">
            <h3>登录日志</h3>
            <p>用户登录记录</p>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="8">
        <el-card shadow="hover" class="admin-card" @click="navigateTo('/admin/oper-logs')">
          <div class="card-icon">
            <el-icon><Document /></el-icon>
          </div>
          <div class="card-content">
            <h3>操作日志</h3>
            <p>系统操作记录</p>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="8">
        <el-card shadow="hover" class="admin-card" @click="navigateTo('/admin/settings')">
          <div class="card-icon">
            <el-icon><Setting /></el-icon>
          </div>
          <div class="card-content">
            <h3>系统设置</h3>
            <p>系统参数配置</p>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { useUserStore } from '@/stores/user'
import { HomeFilled, Tools, UserFilled, User, Document, Setting } from '@element-plus/icons-vue'

const router = useRouter()
const userStore = useUserStore()

// 导航到管理页面
const navigateTo = (path) => {
  router.push(path)
}
</script>

<style scoped>
.admin-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

h1 {
  font-size: 28px;
  color: #333;
  margin-bottom: 10px;
}

.admin-description {
  color: #666;
  margin-bottom: 30px;
}

.card-container {
  margin-top: 20px;
}

.admin-card {
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.3s;
}

.admin-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: #f0f5ff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
}

.card-icon .el-icon {
  font-size: 30px;
  color: #4A60A1;
}

.card-content {
  text-align: center;
}

.card-content h3 {
  font-size: 18px;
  margin: 0 0 10px 0;
  color: #333;
}

.card-content p {
  font-size: 14px;
  color: #666;
  margin: 0;
}
</style> 